package org.micro.neural.degrade;

import lombok.*;
import org.micro.neural.common.event.EventListener;
import org.micro.neural.config.GlobalConfig;

import java.io.Serializable;

/**
 * The Degrade Global Config
 *
 * @author lry
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class DegradeGlobalConfig extends GlobalConfig implements Serializable {

    private static final long serialVersionUID = 3023172841450527624L;

    /**
     * The degrade level
     */
    private DegradeConfig.Level level = DegradeConfig.Level.NON;

    /**
     * The Degrade Event Type.
     *
     * @author lry
     **/
    @Getter
    @AllArgsConstructor
    public enum EventType implements EventListener.EventType {

        /**
         * The notification mock data exception of degrade
         */
        DEGRADE_NOTIFY_EXCEPTION("The notify config is exception of degrade"),
        /**
         * The collect statistics exception of degrade
         */
        DEGRADE_COLLECT_EXCEPTION("The collect statistics is exception of degrade");

        String message;

    }

}
